$(document).ready(function () {
    login();
});
function login(){
    $('.submit-login').click(function(){
        var phone = $('.name').val();
        var password = $('.key').val();
        if (phone.length>=1 && password.length>=6) { //todo 验证
            window.location.href = "#";
        }
        else{
            if(password.length == 0 || phone.length == 0) {
                alert('请输入帐号和密码！！！');
                return;
            }
            if(password.length<6){
                alert('密码最少为6位');
                return;
            }
        }
    })
}